//  type CalcFnType = (n1:number,n2:number)=> number
interface CalcFnType {
  (n1: number, n2: number): number
}
function calc(num1: number, num2: number, calcFn: CalcFnType) {
  return calcFn(num1, num2)
}

const add: CalcFnType = function (n1, n2) {
  return n1 + n2
}
calc(10, 20, add)
